package Java0308;

import java.util.Scanner;

public class Loop16 {
    public static void main(String[] args) {
        //已知：xyz为正整数，满足：
        //xy+z=94
        //x+yz=95
        //求x,y,z的整数解。
        System.out.println("已知：x，y，z为正整数，满足：");
        System.out.println("xy+z=94  x+yz=95");
        System.out.println("求x,y,z的整数解");
        System.out.println();
        int x = 0, y = 0, z = 0;
        //暴力破解
        for (int i = 0; i < 100; i++) {
            for (int j = 0; j < 100; j++) {
                for (int k = 0; k < 100; k++) {
                    if (i * j + k == 94 && i + j * k == 95) {
                        x = i;
                        y = j;
                        z = k;
                        System.out.println("x = " + x + " " + "y = " + y + " " + "z = " + z);
                    }
                }
            }
        }
    }
}
